package com.youyiwen.Mapper;

import com.youyiwen.Bean.Reply;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: zhaoyang
 * @Date: 2021/04/03
 */
@Mapper
public interface ReplyMapper {
    @Insert("insert into reply values (#{id},#{parentId},#{content},#{gmtCreate},#{userName})")
    public void insertReply(Reply reply);

    @Select("select * from reply where parent_id = #{id}")
    public List<Reply> selectReplyListByPId(String id);

    @Select("select count(1) from reply where parent_id = #{parentId}")
    public Integer selectCount(String id);

    @Delete("delete from reply where parent_id = #{id}")
    public void deleteRepliesByParentId(String id);
}
